Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions That Modify Movie Properties / Working With Movie Spatial Characteristics


SetMovieBox

The SetMovieBox function sets a movie's boundary rectangle, or movie box, which is a rectangle that encompasses the spatial representation of all of the movie's enabled tracks. The movie box is in the display coordinate system.

pascal void SetMovieBox (Movie theMovie, const Rect *boxRect);
theMovie
Specifies the movie for this operation. Your application obtains this movie identifier from such functions as NewMovie, NewMovieFromFile, and NewMovieFromHandle (described on page 2-80, page 2-76, and page 2-78, respectively).
boxRect
Contains a pointer to a rectangle that contains the coordinates of the new boundary rectangle.
DESCRIPTION
The Movie Toolbox changes the rectangle by modifying the translation and scale values of the movie's matrix to accommodate the new boundary rectangle.

The movie box might not have its upper-left corner set at (0,0) in its display window when the movie is first loaded. Consequently, your application may need to adjust the position of the movie box so that it appears in the appropriate location within your application's document window. If you don't reset the movie position, the movie might not be visible when it starts playing.

The following sample code demonstrates how to move the boundary rectangle.

GetMovieBox (movie, &movieBox); 
OffsetRect (&movieBox, -movieBox.left, -movieBox.top); 
SetMovieBox (movie, &movieBox);
SPECIAL CONSIDERATIONS
The SetMovieBox function does not call your cover functions.

ERROR CODES
invalidMovie-2010This movie is corrupted or invalid
Memory Manager errors

SEE ALSO
You can modify the movie's matrix directly by calling the SetMovieMatrix function, which is described on page 2-155. You can retrieve a movie's boundary rectangle by calling the GetMovieBox function, which is described in the next section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996